' 
' Copyright (C) 2014 Infinity CCS Ltd (http://www.infinityccs.com/)
' Copyright (C) 2008 Sasa Coh <sasacoh@gmail.com>
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program.  If not, see <http://www.gnu.org/licenses/>. 
'/


Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Runtime.InteropServices

#Region "Config Structure"

''' <summary>
''' Sip Config structure. 
''' BE CAREFUL!
''' SYNCHRONIZE FIELDS WITH C-STRUCTURE IN PJSIPDLL.H!!!!!
''' </summary>
<StructLayout(LayoutKind.Sequential)>
Public Class pjsipConfig
  Private Shared _instance As pjsipConfig = Nothing
  Public Shared ReadOnly Property Instance As pjsipConfig
    Get
      If _instance Is Nothing Then _instance = New pjsipConfig()
      Return _instance
    End Get
  End Property

  Public listenPort As Integer = 5060
  '// warning:::Marshal managed bool type to unmanaged (C) bool !!!!
  <MarshalAs(UnmanagedType.I1)>
  Public noUDP As Boolean = False
  <MarshalAs(UnmanagedType.I1)>
  Public noTCP As Boolean = True
  <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=255)>
  Public stunServer As String
  <MarshalAs(UnmanagedType.I1)>
  Public publishEnabled As Boolean = False

  Public expires As Integer = 3600

  <MarshalAs(UnmanagedType.I1)>
  Public VADEnabled As Boolean = True

  Public ECTail As Integer = 200

  <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=255)>
  Public nameServer As String

  <MarshalAs(UnmanagedType.I1)>
  Public pollingEventsEnabled As Boolean = False

  Public logLevel As Integer = 5
  <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=255)>
  Public logFile As String = "pjsipNET.log"

  '// IMS specifics
  <MarshalAs(UnmanagedType.I1)>
  Public imsEnabled As Boolean = False '// secAgreement rfc 3329
  <MarshalAs(UnmanagedType.I1)>
  Public imsIPSecHeaders As Boolean = False
  <MarshalAs(UnmanagedType.I1)>
  Public imsIPSecTransport As Boolean = False
End Class

#End Region
